package com.example.androidui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.example.androidui.activity.FlexboxActivity;
import com.example.androidui.activity.FlowActivity;
import com.example.androidui.activity.TestActivity;

import java.util.HashMap;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    @BindView(R.id.btn_main_flow_view)
    Button btnMainFlowView;
    @BindView(R.id.btn_main_test)
    Button btnMainTest;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
    }

    @OnClick({R.id.btn_main_flow_view,
            R.id.btn_main_test,
            R.id.btn_main_flow_box})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_main_flow_view:
                goToActivity(FlowActivity.class);
                break;
            case R.id.btn_main_test:
                goToActivity(TestActivity.class);
                break;
            case R.id.btn_main_flow_box:
                goToActivity(FlexboxActivity.class);
                break;
        }
    }

    private void goToActivity(Class<?> cls) {
        Intent intent = new Intent(MainActivity.this, cls);
        startActivity(intent);
    }
}
